package com.mall.admin.controller;

import com.mall.admin.service.OmsOrderReturnReasonService;
import com.mall.commons.utils.PageResult;
import com.mall.commons.utils.R;
import com.mall.domain.OmsOrderReturnReason;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/returnReason")
public class OmsOrderReturnReasonController {

    @Autowired
    private OmsOrderReturnReasonService omsOrderReturnReasonService;

    //分页查询退货原因
    @GetMapping("/list")
    public R list(Integer pageNum,Integer pageSize){
        PageResult pageResult = omsOrderReturnReasonService.list(pageNum,pageSize);
        return R.success("分页查询退货原因",pageResult);
    }

    //获取单个退货原因详情信息
    @GetMapping("/{id}")
    public R findReason(@PathVariable Long id){
        OmsOrderReturnReason omsOrderReturnReason = omsOrderReturnReasonService.findReason(id);
        return R.success("单个退货",omsOrderReturnReason);
    }

}
